package com.ltt.service.impl;

import com.ltt.dao.pojo.Harvest;
import com.ltt.dao.vo.HarvestVo;
import com.ltt.mapper.HarvestMapper;
import com.ltt.service.HarvestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author ‘李天泰’
 * @version 1.0
 * @description: TODO
 * @date 2023/5/2 10:47
 */
@Service
public class HarvestServiceImpl implements HarvestService {
    @Autowired
    private HarvestMapper harvestMapper;

    @Override
    public List<HarvestVo> findAllHarvest(String openid) {
        return harvestMapper.findAllHarvest(openid);
    }

    @Override
    public void insertHarvest(Harvest harvest) {
        harvestMapper.insertHarvest(harvest);
    }

    @Override
    public void updateHarvest(Harvest harvest) {
        harvestMapper.updateHarvest(harvest);
    }

    @Override
    public void deleteHarvest(int id) {
        harvestMapper.deleteHarvest(id);
    }

    @Override
    public Harvest findHarvestById(String openid, int id) {
        return harvestMapper.findHarvestById(openid, id);
    }

    public static void main(String[] args) {
        System.out.println(new Date());
    }
}
